{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "36866067",
   "metadata": {},
   "source": [
    "# 导入数据"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1d31e354",
   "metadata": {},
   "source": [
    "## 导入包"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 124,
   "id": "2a7798a1",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "89327d50",
   "metadata": {},
   "source": [
    "## 导入数据集"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 125,
   "id": "126b0da0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5.1</td>\n",
       "      <td>3.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4.7</td>\n",
       "      <td>3.2</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>145</th>\n",
       "      <td>6.7</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.2</td>\n",
       "      <td>2.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>146</th>\n",
       "      <td>6.3</td>\n",
       "      <td>2.5</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>147</th>\n",
       "      <td>6.5</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.2</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>148</th>\n",
       "      <td>6.2</td>\n",
       "      <td>3.4</td>\n",
       "      <td>5.4</td>\n",
       "      <td>2.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>149</th>\n",
       "      <td>5.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.1</td>\n",
       "      <td>1.8</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>150 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       0    1    2    3\n",
       "0    5.1  3.5  1.4  0.2\n",
       "1    4.9  3.0  1.4  0.2\n",
       "2    4.7  3.2  1.3  0.2\n",
       "3    4.6  3.1  1.5  0.2\n",
       "4    5.0  3.6  1.4  0.2\n",
       "..   ...  ...  ...  ...\n",
       "145  6.7  3.0  5.2  2.3\n",
       "146  6.3  2.5  5.0  1.9\n",
       "147  6.5  3.0  5.2  2.0\n",
       "148  6.2  3.4  5.4  2.3\n",
       "149  5.9  3.0  5.1  1.8\n",
       "\n",
       "[150 rows x 4 columns]"
      ]
     },
     "execution_count": 125,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.datasets import load_iris#导入数据集\n",
    "X = load_iris().data\n",
    "y = load_iris().target\n",
    "pd.DataFrame(X)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 126,
   "id": "4261d6cb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
       "       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
       "       0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
       "       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
       "       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n",
       "       2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n",
       "       2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2])"
      ]
     },
     "execution_count": 126,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "load_iris().target"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3f1b4da3",
   "metadata": {},
   "source": [
    "# 切分数据集"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 127,
   "id": "64e442da",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.model_selection import train_test_split, GridSearchCV, cross_val_score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 128,
   "id": "8a51fae8",
   "metadata": {},
   "outputs": [],
   "source": [
    "Xtrain,Xtest,Ytrain,Ytest = train_test_split(X,y,test_size=0.3,random_state=420)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0f291daf",
   "metadata": {},
   "source": [
    "# 标准化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 129,
   "id": "d62830db",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>-0.153220</td>\n",
       "      <td>-0.137280</td>\n",
       "      <td>0.545585</td>\n",
       "      <td>0.519487</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1.087862</td>\n",
       "      <td>-0.137280</td>\n",
       "      <td>1.335604</td>\n",
       "      <td>1.482065</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2.604741</td>\n",
       "      <td>-0.137280</td>\n",
       "      <td>1.821769</td>\n",
       "      <td>1.344554</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>-1.394302</td>\n",
       "      <td>0.377519</td>\n",
       "      <td>-1.399075</td>\n",
       "      <td>-1.268159</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>-0.980608</td>\n",
       "      <td>0.892318</td>\n",
       "      <td>-1.277534</td>\n",
       "      <td>-1.268159</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0.122576</td>\n",
       "      <td>-0.909478</td>\n",
       "      <td>0.302503</td>\n",
       "      <td>-0.168069</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>-0.704812</td>\n",
       "      <td>1.149717</td>\n",
       "      <td>-1.277534</td>\n",
       "      <td>-1.268159</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>-0.291118</td>\n",
       "      <td>-1.166877</td>\n",
       "      <td>0.484815</td>\n",
       "      <td>0.106953</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>0.398372</td>\n",
       "      <td>-0.137280</td>\n",
       "      <td>0.727897</td>\n",
       "      <td>0.932020</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0.536270</td>\n",
       "      <td>-0.137280</td>\n",
       "      <td>0.606356</td>\n",
       "      <td>0.381976</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>1.639455</td>\n",
       "      <td>0.120120</td>\n",
       "      <td>1.092521</td>\n",
       "      <td>1.344554</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>-0.429016</td>\n",
       "      <td>-0.137280</td>\n",
       "      <td>0.545585</td>\n",
       "      <td>0.519487</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>-1.532200</td>\n",
       "      <td>1.407116</td>\n",
       "      <td>-1.581387</td>\n",
       "      <td>-1.268159</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>-0.980608</td>\n",
       "      <td>-0.137280</td>\n",
       "      <td>-1.216763</td>\n",
       "      <td>-1.268159</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>1.501556</td>\n",
       "      <td>-0.137280</td>\n",
       "      <td>1.153292</td>\n",
       "      <td>1.344554</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>0.122576</td>\n",
       "      <td>-0.909478</td>\n",
       "      <td>0.180961</td>\n",
       "      <td>0.106953</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>-1.807997</td>\n",
       "      <td>0.377519</td>\n",
       "      <td>-1.399075</td>\n",
       "      <td>-1.268159</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>-1.532200</td>\n",
       "      <td>0.892318</td>\n",
       "      <td>-1.338305</td>\n",
       "      <td>-1.130648</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>-1.256404</td>\n",
       "      <td>0.892318</td>\n",
       "      <td>-1.216763</td>\n",
       "      <td>-1.268159</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>-0.842710</td>\n",
       "      <td>1.921915</td>\n",
       "      <td>-1.216763</td>\n",
       "      <td>-1.268159</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>-0.429016</td>\n",
       "      <td>0.892318</td>\n",
       "      <td>-1.155993</td>\n",
       "      <td>-1.268159</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>1.363658</td>\n",
       "      <td>-0.137280</td>\n",
       "      <td>0.970980</td>\n",
       "      <td>1.619576</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>-0.291118</td>\n",
       "      <td>-1.424276</td>\n",
       "      <td>0.241732</td>\n",
       "      <td>0.244464</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>-1.256404</td>\n",
       "      <td>-0.137280</td>\n",
       "      <td>-1.338305</td>\n",
       "      <td>-1.405670</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>1.087862</td>\n",
       "      <td>-0.652078</td>\n",
       "      <td>0.606356</td>\n",
       "      <td>0.519487</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>0.812066</td>\n",
       "      <td>0.634918</td>\n",
       "      <td>0.667127</td>\n",
       "      <td>0.656998</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>-0.842710</td>\n",
       "      <td>0.892318</td>\n",
       "      <td>-1.277534</td>\n",
       "      <td>-1.268159</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>-0.291118</td>\n",
       "      <td>2.951512</td>\n",
       "      <td>-1.338305</td>\n",
       "      <td>-1.268159</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>-0.291118</td>\n",
       "      <td>-1.681676</td>\n",
       "      <td>0.059420</td>\n",
       "      <td>-0.168069</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>1.225760</td>\n",
       "      <td>-0.394679</td>\n",
       "      <td>0.606356</td>\n",
       "      <td>0.244464</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>-0.980608</td>\n",
       "      <td>-1.939075</td>\n",
       "      <td>-0.183662</td>\n",
       "      <td>-0.168069</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>0.812066</td>\n",
       "      <td>-0.909478</td>\n",
       "      <td>0.788668</td>\n",
       "      <td>0.932020</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>1.363658</td>\n",
       "      <td>0.634918</td>\n",
       "      <td>1.274833</td>\n",
       "      <td>1.344554</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>-0.980608</td>\n",
       "      <td>0.634918</td>\n",
       "      <td>-1.338305</td>\n",
       "      <td>-1.268159</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>-0.842710</td>\n",
       "      <td>1.149717</td>\n",
       "      <td>-1.338305</td>\n",
       "      <td>-1.130648</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>0.949964</td>\n",
       "      <td>0.377519</td>\n",
       "      <td>0.545585</td>\n",
       "      <td>0.519487</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>0.812066</td>\n",
       "      <td>0.892318</td>\n",
       "      <td>1.214063</td>\n",
       "      <td>1.757087</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>-0.153220</td>\n",
       "      <td>-0.394679</td>\n",
       "      <td>-0.001350</td>\n",
       "      <td>0.244464</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>0.260474</td>\n",
       "      <td>0.377519</td>\n",
       "      <td>0.727897</td>\n",
       "      <td>0.932020</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>-0.015322</td>\n",
       "      <td>-0.652078</td>\n",
       "      <td>0.545585</td>\n",
       "      <td>0.244464</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>-0.291118</td>\n",
       "      <td>-1.681676</td>\n",
       "      <td>0.120191</td>\n",
       "      <td>-0.030558</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41</th>\n",
       "      <td>0.674168</td>\n",
       "      <td>-0.394679</td>\n",
       "      <td>0.424044</td>\n",
       "      <td>0.244464</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>42</th>\n",
       "      <td>-0.291118</td>\n",
       "      <td>-1.939075</td>\n",
       "      <td>0.241732</td>\n",
       "      <td>0.244464</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>43</th>\n",
       "      <td>0.398372</td>\n",
       "      <td>-0.909478</td>\n",
       "      <td>0.910209</td>\n",
       "      <td>0.656998</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>44</th>\n",
       "      <td>1.087862</td>\n",
       "      <td>-0.137280</td>\n",
       "      <td>1.153292</td>\n",
       "      <td>0.932020</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           0         1         2         3\n",
       "0  -0.153220 -0.137280  0.545585  0.519487\n",
       "1   1.087862 -0.137280  1.335604  1.482065\n",
       "2   2.604741 -0.137280  1.821769  1.344554\n",
       "3  -1.394302  0.377519 -1.399075 -1.268159\n",
       "4  -0.980608  0.892318 -1.277534 -1.268159\n",
       "5   0.122576 -0.909478  0.302503 -0.168069\n",
       "6  -0.704812  1.149717 -1.277534 -1.268159\n",
       "7  -0.291118 -1.166877  0.484815  0.106953\n",
       "8   0.398372 -0.137280  0.727897  0.932020\n",
       "9   0.536270 -0.137280  0.606356  0.381976\n",
       "10  1.639455  0.120120  1.092521  1.344554\n",
       "11 -0.429016 -0.137280  0.545585  0.519487\n",
       "12 -1.532200  1.407116 -1.581387 -1.268159\n",
       "13 -0.980608 -0.137280 -1.216763 -1.268159\n",
       "14  1.501556 -0.137280  1.153292  1.344554\n",
       "15  0.122576 -0.909478  0.180961  0.106953\n",
       "16 -1.807997  0.377519 -1.399075 -1.268159\n",
       "17 -1.532200  0.892318 -1.338305 -1.130648\n",
       "18 -1.256404  0.892318 -1.216763 -1.268159\n",
       "19 -0.842710  1.921915 -1.216763 -1.268159\n",
       "20 -0.429016  0.892318 -1.155993 -1.268159\n",
       "21  1.363658 -0.137280  0.970980  1.619576\n",
       "22 -0.291118 -1.424276  0.241732  0.244464\n",
       "23 -1.256404 -0.137280 -1.338305 -1.405670\n",
       "24  1.087862 -0.652078  0.606356  0.519487\n",
       "25  0.812066  0.634918  0.667127  0.656998\n",
       "26 -0.842710  0.892318 -1.277534 -1.268159\n",
       "27 -0.291118  2.951512 -1.338305 -1.268159\n",
       "28 -0.291118 -1.681676  0.059420 -0.168069\n",
       "29  1.225760 -0.394679  0.606356  0.244464\n",
       "30 -0.980608 -1.939075 -0.183662 -0.168069\n",
       "31  0.812066 -0.909478  0.788668  0.932020\n",
       "32  1.363658  0.634918  1.274833  1.344554\n",
       "33 -0.980608  0.634918 -1.338305 -1.268159\n",
       "34 -0.842710  1.149717 -1.338305 -1.130648\n",
       "35  0.949964  0.377519  0.545585  0.519487\n",
       "36  0.812066  0.892318  1.214063  1.757087\n",
       "37 -0.153220 -0.394679 -0.001350  0.244464\n",
       "38  0.260474  0.377519  0.727897  0.932020\n",
       "39 -0.015322 -0.652078  0.545585  0.244464\n",
       "40 -0.291118 -1.681676  0.120191 -0.030558\n",
       "41  0.674168 -0.394679  0.424044  0.244464\n",
       "42 -0.291118 -1.939075  0.241732  0.244464\n",
       "43  0.398372 -0.909478  0.910209  0.656998\n",
       "44  1.087862 -0.137280  1.153292  0.932020"
      ]
     },
     "execution_count": 129,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.preprocessing import StandardScaler #标准化\n",
    "std = StandardScaler()\n",
    "Xtrain_std = std.fit_transform(Xtrain)#训练集标准化之后的数据集\n",
    "Xtest_std = std.fit_transform(Xtest)#测试集标准化之后的数据集\n",
    "pd.DataFrame(Xtrain_std)\n",
    "pd.DataFrame(Xtest_std)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5860e35c",
   "metadata": {},
   "source": [
    "## 逻辑回归建模"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 130,
   "id": "baa3b1f1",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.linear_model import LogisticRegression as LR"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 131,
   "id": "ff906497",
   "metadata": {},
   "outputs": [],
   "source": [
    "lrl1 = LR(penalty=\"l1\",solver=\"liblinear\",C=0.5,max_iter=1000)\n",
    "lrl2 = LR(penalty=\"l2\",solver=\"liblinear\",C=0.5,max_iter=1000)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 132,
   "id": "3aada9e5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0.9047619047619048, 0.8857142857142857)"
      ]
     },
     "execution_count": 132,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lrl1 = lrl1.fit(Xtrain_std,Ytrain)\n",
    "lrl1.coef_ # w 参数值 \n",
    "\n",
    "lrl2 = lrl2.fit(Xtrain_std,Ytrain)\n",
    "lrl2.coef_ # w 参数值 \n",
    "lrl1.score(Xtrain_std,Ytrain),lrl2.score(Xtrain_std,Ytrain)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a1cadf9b",
   "metadata": {},
   "source": [
    "## 绘制学习曲线"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 133,
   "id": "812095fe",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAFlCAYAAADlICPeAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAABMcUlEQVR4nO3dd3hUVf7H8feZTAok9BKEAAEpgnRiRZqIxEIHBaQoKoqirri6uNgWEVFX1koAAREQqQphYcFCFaQEaQFJgEwgCSUhhJKEZNr5/ZHgL1LCJJmSmXxfz5PHzL3n3vlOhE8u5557jtJaI4QQwncZPF2AEEII15KgF0IIHydBL4QQPk6CXgghfJwEvRBC+DgJeiGE8HFGTxdwperVq+vw8HBPlyGEEF5l165dZ7TWNa61r9QFfXh4ODExMZ4uQwghvIpS6tj19knXjRBC+DgJeiGE8HES9EII4eMk6IUQwsdJ0AshhI+ToBdCCB8nQS+EED5Ogl4IIXycBL0QQvg4CXohhPBxEvRCCOHjJOiFEKIUOHr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2IG5JpiksxpdRQIALo7Ola3EkpZQCm8P8rlZVFRvK6b7qQ9y+6TUqpllrrc54syo0GA3O01h8rpe4C5imlWmit7Z4uzBvJFb373XCxdQCl1H3AeKCX/v+F133FjX4GFYAWwAalVCJ5/ZTRPnRD1pE/A8lAtNbaorU2AfHkBb8vcOTzPwksBtBa/wYEkTcPTFngUEYUhQS9+zmy2HpbYDp5Ie9LfbOXFfoz0Fqf11pX11qHa63DybtP0Utr7StrTN7wzwCwnLyreZRS1cnryklwY42u5MjnPw50A1BKNSMv6MvK0lLRwPD80Td3Aue11idLckLpunEz7dhi6x8BIcCS/LUxj2ute3msaCdz8Gfgsxz8/GuB+5VSBwEb8KrWOt1zVTuPg5//FeArpdTL5N2YfVznD0nxdkqp78j7JV49/x7E24A/gNZ6Gnn3JB4EjgDZwBMlfk8f+dkJIYS4Dum6EUIIHydBL4QQPk6CXgghfJwEvRBC+DgJeiGE8HES9EII4eMk6IUQwsdJ0AshhI/7P/nv2nM/35DxAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "from sklearn.metrics import accuracy_score\n",
    "l1 = []\n",
    "l2 = []\n",
    "l1test = []\n",
    "l2test = []\n",
    "Xtrain,Xtest,Ytrain,Ytest = train_test_split(X,y,test_size=0.3,random_state=420)\n",
    "for i in np.linspace(0.05,1,19):\n",
    "    lrl1 = LR(penalty=\"l1\",solver=\"liblinear\",C=i,max_iter=1000)\n",
    "    lrl2 = LR(penalty=\"l2\",solver=\"liblinear\",C=i,max_iter=1000)\n",
    "    lrl1 = lrl1.fit(Xtrain,Ytrain)\n",
    "    l1.append(accuracy_score(lrl1.predict(Xtrain),Ytrain))\n",
    "    l1test.append(accuracy_score(lrl1.predict(Xtest),Ytest))\n",
    "    lrl2 = lrl2.fit(Xtrain,Ytrain)\n",
    "    l2.append(accuracy_score(lrl2.predict(Xtrain),Ytrain))\n",
    "    l2test.append(accuracy_score(lrl2.predict(Xtest),Ytest))\n",
    "graph = [l1,l2,l1test,l2test]\n",
    "color = [\"green\",\"black\",\"lightgreen\",\"gray\"]\n",
    "label = [\"L1\",\"L2\",\"L1test\",\"L2test\"]\n",
    "plt.figure(figsize=(6,6))\n",
    "for i in range(len(graph)):\n",
    "    plt.plot(np.linspace(0.05,1,19),graph[i],color[i],label=label[i])\n",
    "plt.legend(loc=4) #图例的位置在哪⾥?4表示，右下⻆\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 134,
   "id": "68520b40",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "c:\\users\\loushang\\appdata\\local\\programs\\python\\python37\\lib\\site-packages\\sklearn\\linear_model\\_sag.py:329: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge\n",
      "  \"the coef_ did not converge\", ConvergenceWarning)\n",
      "c:\\users\\loushang\\appdata\\local\\programs\\python\\python37\\lib\\site-packages\\sklearn\\linear_model\\_sag.py:329: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge\n",
      "  \"the coef_ did not converge\", ConvergenceWarning)\n",
      "c:\\users\\loushang\\appdata\\local\\programs\\python\\python37\\lib\\site-packages\\sklearn\\linear_model\\_sag.py:329: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge\n",
      "  \"the coef_ did not converge\", ConvergenceWarning)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.legend.Legend at 0x27e6c0a96c8>"
      ]
     },
     "execution_count": 134,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYMAAAD4CAYAAAAO9oqkAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAA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JgQETOK+h471PUV/hXwbGZ27WkoY/z6+1yhnu/BQzkjPlQ/VGbO11FJ6C+XXMvvU9lVexpYUfycB3wfeKZoXwIcV2KNJ1E5W2MlsGrPmAGTgQeB54CfAkeXWOMRQC9wZFVbaWNIJZReAt6gcvz1c/2NF5UzOG4p3o/PAG0l1ddB5bjxnvfhd4q+nyhe9xXAk8AfllRfv68n8OVi/NYC55ZRX9F+O/Af+vQtY/z6+1yp23vQy1FIkkbFYSJJ0iAZBpIkw0CSZBhIkjAMJEkYBpIkDANJEvD/ACxNTq8SV9fOAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 确定C=0.9 关于最大迭代次数绘制学习曲线\n",
    "l2 = []\n",
    "l2test = []\n",
    "\n",
    "for i in range(1,201,10):\n",
    "    lrl2 = LR(penalty='l2',solver='sag',C=0.9,max_iter=i).fit(Xtrain_std,Ytrain)\n",
    "    l2.append(lrl2.score(Xtrain_std,Ytrain))\n",
    "    l2test.append(lrl2.score(Xtest_std,Ytest))\n",
    "    \n",
    "plt.plot(range(1,201,10),l2,label='l2')\n",
    "plt.plot(range(1,201,10),l2test,label='l2test')\n",
    "plt.legend(loc=4)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "433f6a1c",
   "metadata": {},
   "source": [
    "# 网格搜索-确定最优参数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 135,
   "id": "f22b49dd",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.model_selection import GridSearchCV #网格搜索\n",
    "from sklearn.preprocessing import StandardScaler #标准化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 136,
   "id": "82d00851",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "GridSearchCV(cv=5, estimator=LogisticRegression(max_iter=10000),\n",
       "             param_grid={'C': [0.05, 0.10277777777777777, 0.15555555555555556,\n",
       "                               0.20833333333333331, 0.2611111111111111,\n",
       "                               0.3138888888888889, 0.36666666666666664,\n",
       "                               0.41944444444444445, 0.4722222222222222, 0.525,\n",
       "                               0.5777777777777778, 0.6305555555555556,\n",
       "                               0.6833333333333333, 0.7361111111111112,\n",
       "                               0.788888888888889, 0.8416666666666667,\n",
       "                               0.8944444444444445, 0.9472222222222223, 1.0],\n",
       "                         'solver': ['liblinear', 'sag', 'newton-cg', 'lbfgs']})"
      ]
     },
     "execution_count": 136,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p = {\n",
    "    'C':list(np.linspace(0.05,1,19)),\n",
    "    'solver':['liblinear','sag','newton-cg','lbfgs']\n",
    "}\n",
    "\n",
    "model = LR(penalty='l2',max_iter=10000)\n",
    "\n",
    "GS = GridSearchCV(model,p,cv=5)\n",
    "GS.fit(Xtrain_std,Ytrain)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 137,
   "id": "d194de8a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.9714285714285715"
      ]
     },
     "execution_count": 137,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "GS.best_score_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 138,
   "id": "8a9a3d46",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'C': 0.41944444444444445, 'solver': 'sag'}"
      ]
     },
     "execution_count": 138,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "GS.best_params_"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "id": "fcce4170",
   "metadata": {},
   "source": [
    "# 查看训练集和测试集下的分数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 139,
   "id": "8b7d650d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0.9809523809523809, 0.8888888888888888)"
      ]
     },
     "execution_count": 139,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.fit(Xtrain_std,Ytrain)\n",
    "model.score(Xtrain_std,Ytrain),model.score(Xtest_std,Ytest)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ae1ab354",
   "metadata": {},
   "source": [
    "# 计算精准率"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 140,
   "id": "e59868ac",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn import metrics"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 156,
   "id": "7ed7e0f8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[15,  0,  0],\n",
       "       [ 0, 13,  7],\n",
       "       [ 0,  0, 10]], dtype=int64)"
      ]
     },
     "execution_count": 156,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "metrics.confusion_matrix(Ytest,GS.predict(Xtest_std))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 157,
   "id": "86c63165",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.8444444444444444"
      ]
     },
     "execution_count": 157,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "metrics.precision_score(Ytest,GS.predict(Xtest_std), average='micro')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "27ae5461",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
